package com.questetra.OAuth.core
{
    public class Parameter
    {
        public function Parameter(k:String, v:String)
        {
            if (k == null || k.length == 0)
            {
                throw new ArgumentError("Empty key given, a valid key must be at least one character");
            }
            key = k;
            value = v;
        }

        public function set key(k:String):void
        {
            if(k == null || k.length == 0)
            {
                throw new ArgumentError("Empty key given, a valid key must be at least one character");
            }
            _key = k;
        }
        public function get key():String
        {
            return _key;
        }

        public function set value(v:String):void
        {
            _value = v;
            _valueEncoded = encodeURIComponent(v);
        }
        public function get value():String
        {
            return _value;
        }

        public function get valueEncoded():String
        {
            return _valueEncoded;
        }

        private var _key:String = "";
        private var _value:String = "";
        private var _valueEncoded:String = "";
    }
}